<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>区域管理编辑</title>
	<!-- import css and js --> 
	<%@ include file="/common/metaInput.jsp" %>  
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
<script type="text/javascript">
var basic_Url="${ctx}/security/menu";
$(function(){
$("#inputForm").validate({			   
	onsubmit: true,
	 /*执行ajaxsubmit  */ 
    submitHandler: function(editform) {
            
        //alert(jsonInfo); 
        try{			    		
            url =  basic_Url+"/save.do";
            var api = frameElement.api;
        	var W = api.opener;
        
            getReturnMessage(url,"inputForm",W.gettreeData);	
        }catch(e){alert(e)}
    }
 }
);

$("#state").change(function(){ 
	//alert($("#state").find("option:selected").text());
	  $("#removed").val($("#state").val());
	 // $("#removed").val($("#state").find("option:selected").text());
	}); 
 
 
});
function submitForm(){
    //设置ajax全局同步
	jQuery.ajaxSettings.async = false;
  	/** $("#submitFlag").val(param);**/
    $("#inputForm").submit();
 }		
	
</script>

</head>

<body>

<form id="inputForm" action="" method="post">
<input type="hidden" id="id" name="id" value="${menu.id}"/>
<input type="hidden" id="mid" name="mid" value="${ID}"/>
<!-- 用于标识提交按钮 -->
<input type="hidden" id="submitFlag" value="" />
 <div class="pageContent" >
    <div class="panel">
         <table class="TableBlock" align="center">
                   <tr>
                    <td colspan="3">菜单名称:</td>
   		                 <td>
   		                <input type="text" id="name" name="name" style="width: 300px;" class="required" value="${menu.name}" />
   		                 </td>
   		           </tr>
   		           <tr>
   		           	<td>菜单路径:</td>
   		           	<td colspan="3"><input type="text" id="url" style="width: 300px;" name="url" class="required" value="${menu.url}" /></td>
   		           </tr>
   		           <tr>
   		             <td>状态:</td>
   		             <td colspan="3">
   		             <select id="state" name="state" class="required" style="width: 200px;">
   		                 	<option></option>
   		                 	<option id="0" value='0'>正常</option>
   		                 	<option id="1" value='1'>锁定</option>
   		             </select>
   		             <input type="hidden" id="menuid" name="menuid" value="${menu.menuid}" />
   		             <input type="hidden" id="removed" name="removed" value="${menu.removed}" />
   		             <script type="text/javascript">
   		               $("#"+'${menu.removed}').attr("selected","selected");
   		             </script>
   		             </td>
   		           </tr>
                </table>               
         </div>
         <div class="formBar">
	        <ul>
		       <li><div class="buttonActive"><div class="buttonContent"><button type="button" id="save" onclick="submitForm()">保存</button></div></div></li>
		       <li><div class="button"><div class="buttonContent"><button type="button" class="print" onclick="CloseDialog()">关闭</button></div></div></li>
	        </ul>
        </div>    
    </div>
</form>
</body>
</html>
